
def fun(n):
    if n<=1:
        return n
    else:
        return n * fun(n-1)

n = int(input())
sum = 0

for i in range(1,n+1):
    sum+=fun(i)
print(sum)



